package com.tange.ai.core.sample.token

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.tange.ai.core.sample.BuildConfig
import com.tange.base.toolkit.Tips

class DispatcherActivity: AppCompatActivity() {

    private companion object {
        const val ACCESS_TOKEN_GRANT_MODE_INTERNAL = "internal_account"
        const val ACCESS_TOKEN_GRANT_MODE_THIRD = "third_party_account"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        if (BuildConfig.ACCESS_TOKEN_GRANT_MODE == ACCESS_TOKEN_GRANT_MODE_INTERNAL) {
            startActivity(Intent(this@DispatcherActivity, InternalAccountLoginActivity::class.java))
        } else if (BuildConfig.ACCESS_TOKEN_GRANT_MODE == ACCESS_TOKEN_GRANT_MODE_THIRD) {
            startActivity(Intent(this@DispatcherActivity, ThirdPartyAccountLoginActivity::class.java))
        } else {
            Tips.show("ACCESS_TOKEN_GRANT_MODE 参数配置错误！")
        }

        finish()
    }
}